package kr.ac.konkuk.db.quadtree.node;

public enum NodeType {
	LEFT_BOTTOM(0, "LEFT_BOTTOM"), 
	LEFT_TOP(1, "LEFT_TOP"), 
	RIGHT_BOTTOM(2, "RIGHT_BOTTOM"), 
	RIGHT_TOP(3, "RIGHT_TOP");
	
	private int index;
	private String msg;
	
	private NodeType(int index, String msg) {
		this.index = index;
		this.msg = msg;
	}
	
	public int index() {
		return index;
	}
	
	public static NodeType valueOf(int index) {
		for (NodeType t : NodeType.values()) {
			if (t.index() == index) {
				return t;
			}
		}
		
		return null;
	}
	
	public String toString() {
		return msg;
	}
}
